package org.jks.service;

import java.util.ArrayList;
import java.util.List;

import org.jks.model.DeviceType;
import org.springframework.stereotype.Service;

@Service
public class DeviceTypeService extends EntityService<DeviceType>{
	
	public DeviceTypeService(){
		MODEL_NAME = DeviceType.class.getSimpleName();
		CLASS_NAME = DeviceType.class;
	}
	
	public DeviceType findByName(String name){
		List<Object> param = new ArrayList<Object>();
		param.add(name);
		return get("from DeviceType where Name=?" , param);
	}
	
	public List<DeviceType> listForSpareParts(){
		return find("from DeviceType where Id>1");
	}
}